Get Request Details
Introduction
The following Assetic REST API endpoints may be used to retrieve one or more work requests.
- GET /api/v2/workrequest/{id}
- Returns a single work request for the given work request GUID
- GET /api/v2/workrequest
- Paginated list of work requests.
- Search filters, pagination and ordering can be applied as per the article Search-Filters-and-Pagination
Sample Payloads
Get a single work request by ID
The Assetic REST API endpoint GET /api/v2/workrequest/{id} is used to retrieve the details of the work request identified by the work request unique identifier. Note that since this is a GET request, there are no parameters in the request body, the URL string defines the work request to retrieve via {id}
For example:
https://[your_site].assetic.net/api/v2/workrequest/c1f463fd-f367-e615-9558-06edd62953d7
Get multiple work requests
The example below gets all work requests where the last modified date is greater than or equal to the datetime 01-January-2019 15:08:35. It gets the first page of 500 records and sorts by "FriendlyId" in descending order
https://[your_site].assetic.net/api/v2/workrequest?requestParams.sorts=FriendlyIdStr-desc&requestParams.filters=LastModified~gte~'2019-01-01T15:08:35'&requestParams.page=1&requestParams.pageSize=500
Response Body
The response body contains the work request data.
The following key fields will be reviewed
- Status
- Supporting Information History
- Work Request ID
- Work Order ID
Refer to the article Create Work Request for a more extensive list of Work Request fields
Status
The field 'WorkRequestStatus' returns the user friendly status as a string, and the field 'WorkRequestStatusId' returns an integer.
The statuses are shown in the table below:
Friendly Status | Status Id | UI Status Code |
New | 2 | NEW |
Assigned | 9 | ASSIGNED |
Queued | 3 | QUEUED |
InProgress | 4 | INPRG |
Resolved | 5 | RESOLVED |
Rejected | 6 | REJECTED |
Closed | 7 | CLOSED |
Cancelled | 8 | CANCELLED |
Supporting Information History
Each comment that has been added to the request is returned as an object with the comment, timestamp and source. Each comment also has a unique GUID reference. The field containing this list is 'SupportingInformationHistory'
The fields in the 'SupportingInformationHistory' object are:
Field | Description |
CreatedDateTime | A datetime field with the timestamp of when the comment was added |
Description | The comment |
CreatedBy | The GUID of the resource that created the comment |
Id | The GUID of the comment |
Work Request ID
The user friendly ID of the request is returned as a string in the field 'FriendlyIdStr'. This is the ID the user sees.
Work Order ID
The GUID of the work order is returned as a GUID (string) in the field 'WorkOrderId'. This ID can be used to retrieve details of the associated work order including the Work Order Status and Comments History.
Sample Response
The following is a sample response body for the GET request.
{ "Description": "REST API library sample", "FeedbackRequired": False, "ExternalIdentifier": CRM123, "WorkRequestTypeId": 3, "WorkOrderId": None, "SupportingInformationHistory": [ { "Description": "Sample information 2", "CreatedDateTime": "2016-05-27T16:26:28.717+10:00", "CreatedBy": "36bee8ab-4e39-4f1d-b713-4eefa521fcd8", "Id": "40f64ef1-d323-e611-9458-06edd62954d7" }, { "Description": "sample information 1", "CreatedDateTime": "2016-05-27T16:25:54.917+10:00", "CreatedBy": "36bee8ab-4e39-4f1d-b713-4eefa521fcd8", "Id": "c5d9c1df-d323-e611-9458-06edd62954d7" } ], "ContactType": 1, "WorkRequestSubTypeId": 12, "WorkRequestSourceId": 3, "CreatedDateTime": "2016-05-27T11:28:57.863+10:00", "AcknowledgeDueDate": "2016-05-30T11:28:57.863+10:00", "WorkRequestStatus": "New", "FeedbackMethodId": 1, "AttachedDocuments": [], "ComplexAssetId": None, "ClosedDate": None, "Id": "0b8b6563-aa23-e611-9458-06edd62954d7", "WorkRequestPriorityId": 3, "CreatedBy": "36bee8ab-4e39-4f1d-b713-4eefa521fcd8", "ResolutionDueDate": "2016-06-03T11:28:57.863+10:00 "WorkRequestSpatialLocation": { "PointString": None, "Point": {"Geography": {"CoordinateSystemId": 4326, "WellKnownText": "POINT (144.9651119 -37.8162149)" } } }, "RequestorId": "58487b6f-1ed1-4fac-a2ec-b235acbe3628", "WorkOrderPriorityId": 1, "ReactiveInspectorId": "32bee8ab-4e39-4f1d-b713-4eefa521fcd8", "ReactiveInspector": { "Id": "32bee8ab-4e39-4f1d-b713-4eefa521fcd8", "DisplayName": "Rafael Nadal", "_links": [], "_embedded": null }, "ReactiveInspectionDate": null, "Location": "Dummy value", "FriendlyIdStr": "WR2274", "WorkRequestPhysicalLocation": { "AddressId": "0c8b6563-aa23-e611-9458-06edd62954d7", "OtherLocation": "other location", "Address": { "ZipPostcode": 3000, "Country": "Australia", "State": "Victoria", "StreetAddress": "Collins Street", "StreetNumber": "257", "CitySuburb": "Melbourne", "GooglePlaceId": "ChIJJ2bMR7RC1moRXM-TysbX378", "Id": "0c8b6563-aa23-e611-9458-06edd62954d7" }, "WhereLocation": "where location" } }
This article on the Integration SDK section demonstrates how to get the work request details via Python script.